#################################
# Makefile : Make realtime.
#################################

FFLAG = -static -ffixed-line-length-132 -g

ifneq (,$(findstring olympus,$(HOSTNAME)))
  BITS=64
  FFLAG+=-m64
  CERNDIR=$(CERN)/$(CERN_LEVEL)/lib64
#  @echo Building 64-bit version with cernlib: $(CERNDIR)
else
  BITS=32
  FFLAG+=-m32
  CERNDIR=$(CERN)/$(CERN_LEVEL)/lib
#  @echo Building 32-bit version with cernlib: $(CERNDIR)
endif

#----------------------------
#  Some default image names
#----------------------------

#----------------------------------
#  Default libraries search path
#----------------------------------


#-----------------------------------
#  Main program or control routines
#-----------------------------------

NAME = hbread_cb
LOCALF2 = $(NAME).f

#----------------------------------
#  Undefined symbols for ld
#----------------------------------

#----------------------------------
#  Libraries
#----------------------------------

CERNBAG = -L$(CERNDIR) \
	-lgraflib \
	-lmathlib \
	-lpacklib
GD_LIB = ../lib/hblib.a

LIBS = $(GD_LIB) $(CERNBAG)

#-----------------------------------
#    Action section
#-----------------------------------

getdat: $(LOCALF2) 
	@echo Building with $(BITS) bits and cernlib located at $(CERNDIR)
	gfortran   $(LOCALF2) \
	      $(FFLAG) $(LIBS) -o $(NAME)
	mv $(NAME) ../bin
	




